package org.bozo.im.service.protocols.xmpp.util.encoding;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import org.bozo.im.service.Constants;

import android.util.Log;

public class Sha1 {

	public static byte[] encode(String pValue) {

		byte[] lRes = null;
		
		try {
			MessageDigest lDigest = MessageDigest.getInstance("SHA-1");
			lDigest.update(pValue.getBytes());
			lRes = lDigest.digest();
		} catch (NoSuchAlgorithmException e) {
			// ---------------------------------------------------------------------------------------
			Log.e(Constants.ACTIVITY_TAG, "org.bozo.im.xmpp.util.encoding.Sha1.encode ---------- ", e);
			// ---------------------------------------------------------------------------------------
		}
		
		return lRes;
	}

}
